<?php

include_once("../service/recruitmentService.php");

$recIDs = $_POST['checkbox'];
$recID = $_GET['recId'];

if (isset($recIDs)) {
    if (!empty($recIDs)) {
        foreach ($recIDs as $id) {
            deleteRecruitment($id);
        }
        Header("Location: ../admin-page/recruitment.php?message=ok");
        return;
    }
} else if (isset($recID)) {
    deleteRecruitment($recID);
    Header("Location: ../admin-page/recruitment.php?message=ok");
    return;
} else {
    Header("Location: ../admin-page/recruitment.php");
}
?>